package com.quik.web.front.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.quik.common.Constants;
import com.quik.entity.SysRoleRight;
import com.quik.web.user.service.AccountService;

/**
 * 功能说明：
 *        处理手牌的业务逻辑
 * @author Jenny
 *
 */
@Controller
@RequestMapping("/main")
public class MainController {
	static Logger log = (Logger)Logger.getLogger(MainController.class);
	
	@Autowired
	private AccountService accountService;
	
	/**
	 * 手牌列表 (显示手牌号、类型、状态)
	 * @return
	 */
	@RequestMapping(value = "main", method = RequestMethod.GET)
	public ModelAndView tokenList(HttpServletRequest request){
		ModelAndView mav = new ModelAndView("/front/consult/token/main");
		List<SysRoleRight> rights = (List<SysRoleRight>) request.getSession().getAttribute(Constants.SESSION_AC);
		mav.addObject("rights", rights);
		log.info("rights = "+(rights==null?-1:rights.size()));
		return mav;
	}
}